# 设置cmake版本号
cmake_minimum_required(VERSION 3.16.5)

# 设置项目名称
project(uikit)

set(CMAKE_C_COMPILER "gcc")
set(CMAKE_CXX_COMPILER "g++")
set(CMAKE_CXX_STANDARD 11)
add_compile_options(-std=c++11)

set(CMAKE_C_COMPILER "x86_64-w64-mingw32-gcc")
set(CMAKE_CXX_COMPILER "x86_64-w64-mingw32-g++")
set(CMAKE_EXPORT_COMPILE_COMMANDS true)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/bin)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/bin)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/bin)
set(LIBRARY_OUTPUT_PATH ${CMAKE_CURRENT_SOURCE_DIR}/bin)

set(ROOT_DIR ${CMAKE_CURRENT_SOURCE_DIR})
set(UIDIR ${ROOT_DIR}/graphic/ui)
set(UTILS ${ROOT_DIR}/graphic/utils)
set(SURFACE ${ROOT_DIR}/graphic/surface)

set(DEPS ${ROOT_DIR}/deps)
set(APP ${ROOT_DIR}/app)


# 头文件路径
include_directories(${ROOT_DIR}/product)
include_directories(${UIDIR}/frameworks)
include_directories(${UIDIR}/interfaces/kits)
include_directories(${UIDIR}/interfaces/kits/animator)
include_directories(${UIDIR}/interfaces/kits/common)
include_directories(${UIDIR}/interfaces/kits/components)
include_directories(${UIDIR}/interfaces/kits/dfx)
include_directories(${UIDIR}/interfaces/kits/events)
include_directories(${UIDIR}/interfaces/kits/font)
include_directories(${UIDIR}/interfaces/kits/layout)
include_directories(${UIDIR}/interfaces/kits/themes)
include_directories(${UIDIR}/interfaces/kits/window)
include_directories(${UIDIR}/interfaces/innerkits)

include_directories(${UTILS}/interfaces/kits)
include_directories(${UTILS}/interfaces/kits/gfx_utils)
include_directories(${UTILS}/interfaces/innerkits)

include_directories(${SURFACE}/interfaces/kits)

include_directories(${ROOT_DIR}/graphic/display/interfaces/include)
include_directories(${ROOT_DIR}/product)

include_directories(${DEPS}/SDL2/include)
include_directories(${DEPS}/bounds_checking_function/include)
include_directories(${DEPS}/bounds_checking_function/src)
include_directories(${DEPS}/cJSON)
include_directories(${DEPS}/icu/icu4c/source/common)
include_directories(${DEPS}/freetype/include)
include_directories(${DEPS}/qrcodegen/cpp)
include_directories(${DEPS}/libjpeg)

include_directories(${APP})
include_directories(${APP}/mainView)
include_directories(${APP}/mainView/events)
include_directories(${APP}/mainView/custom)

#add source code files
if (RELEASE_VERSION)
add_definitions(-DRELEASE_VERSION)
endif()

aux_source_directory(./  main_file)
aux_source_directory(${APP}  appfile)
aux_source_directory(${APP}/mainView  viewfile)
aux_source_directory(${APP}/mainView/custom  customfile)

set(OBJ_SRC ${main_file} ${appfile} ${viewfile} ${customfile})

add_definitions(-DVERSION_IOT -DBOARD_CS -DVERSION_LITE)
#add link library path
link_directories(${DEPS}/SDL2/lib/x64)
link_directories(${CMAKE_CURRENT_SOURCE_DIR}/bin)

set(LINK_LIBS uikit harfbuzz gpu_rm.dll freetype.dll icu.dll qrcodegen.dll BLOCK_HTC.dll libjpeg.dll)
set(LINK_LIBS ${LINK_LIBS} mingw32 SDL2main SDL2.dll)

set(TARGET_NAME watch)
#set project output files
add_executable(${TARGET_NAME} ${OBJ_SRC})
#add link libraries
TARGET_LINK_LIBRARIES(${TARGET_NAME} ${LINK_LIBS})
